﻿using Microsoft.AspNetCore.Mvc.Filters;

namespace O.M.Production.Write.API
{

        /// <summary>
        /// 全局异常过滤器
        /// </summary>
        public class FxxFilter : IExceptionFilter
        {
            private readonly ILogger<FxxFilter> _logger;

            public FxxFilter(ILogger<FxxFilter> logger)
            {
                _logger = logger;
            }
            /// <summary>
            /// 异常过滤
            /// </summary>
            /// <param name="context">异常上下文</param>
            public void OnException(ExceptionContext context)
            {
                _logger.LogError("异常过滤器报错：" + context.Exception.Message);
            }
        }

}
